package router

import (
	"github.com/gin-gonic/gin"

	"message-center/handle/v1/demo"
	"message-center/handle/v1/task"
	"message-center/handle/webhook"
)

func Route(router *gin.Engine) {
	// API doc
	router.Static("/doc", "doc/")

	// 示例demo
	d := router.Group("/api/v1/demo")
	{
		d.GET("/health", demo.HealthCheck)
		d.GET("/disk", demo.DiskCheck)
		d.GET("/cpu", demo.CPUCheck)
		d.GET("/ram", demo.RAMCheck)
	}
	// task
	t := router.Group("/api/v1/send/task")
	{
		t.POST("/mail", task.SendMail)
		t.POST("/ding", task.SendDing)
		t.POST("/sms", task.SendSms)
	}
	// webhook
	router.POST("/webhook", webhook.WebHook)

	// u := g.Group("/api/v1/user")
	//u.Use(middleware.AuthMiddleware())
	// {
	// 	u.POST("", user.Create)
	// 	u.PUT("/:id", user.Modify)
	// 	u.GET("", user.List)
	// 	u.GET("/:id", user.Get)
	// }
}
